<template>
  <div class="control-item">
    <div class="control-header">
      <span class="control-name">选项卡</span>
    </div>
    <div class="control-body">
      <div class="control-section">
        <!-- 背景配置 -->
        <bgControl
          :backgroudData="params.params.tab"
          :showHiddenIcons="false"
          @resetBg="resetBg"
        ></bgControl>
      </div>
    </div>
  </div>
</template>

<script>
import { diyTopPic } from "@/components/DiyNew/diy/dataConfig/config.js";
import bgControl from "@/components/DiyNew/diy/baseControl/bgControl/index.vue";

export default {
  name: "diyTopPicTabControl",
  components: {
    bgControl,
  },
  props: {
    params: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {};
  },
  watch: {},
  computed: {},
  methods: {
    // 点击重置按钮
    resetItem(type) {
      let data = Object.assign({}, diyTopPic);
      this.$set(this.params.params, type, data.params[type]);
    },
    resetBg() {
      this.resetItem("tab");
    },
  },
};
</script>

<style lang="scss" scoped>
.control-item {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  .control-header {
    width: 100%;
    height: 48px;
    background: #ffffff;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px 14px 24px;
    span {
      font-size: 12px;
      color: #8c8c8c;
    }
    .control-name {
      font-size: 14px;
      font-weight: 600;
      color: #000000;
    }
    span:nth-child(2) {
      cursor: pointer;
    }
  }
  .control-body {
    width: 100%;
    padding-bottom: 20px;
    .control-section {
      width: 228px;
      margin: 0 auto;
      text-align: center;
      .control-item {
        width: 100%;
        .control-title {
          padding: 24px 0 14px 0;
          font-size: 12px;
          color: #000000;
          text-align: left;
        }
        .control-content {
          .example-list {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            .example-item {
              width: 70px;
              height: 53px;
              background: #f6f7f9;
              border-radius: 4px;
              margin-right: 6px;
              margin-bottom: 6px;
              display: flex;
              justify-content: center;
              align-items: center;
              cursor: pointer;
              img {
                width: 66px;
              }
            }
            .example-item:last-child {
              margin-right: 0;
            }
            .active {
              border: 2px solid #1890fc;
            }
          }
        }
      }
    }
  }
}
</style>
